// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 培训记录列表 GET /api/traininfo */
export async function queryTraininfo(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/traininfo', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新培训记录 PUT /api/traininfo */
export async function updateTraininfo(body: API.TraininfoItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/traininfo', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加培训记录 POST /api/traininfo */
export async function addTraininfo(body: API.TraininfoItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/traininfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除培训记录 DELETE /api/traininfo */
export async function removeTraininfo(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/traininfo', {
    method: 'DELETE',
    ...(options || {}),
  });
}
